Optimal. Leaf size=196 \[ -\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-c (2 a d h-2 a e g+b d g+b e f)+b h (b d-a e)+2 c^2 d f\right )}{c \sqrt{b^2-4 a c} \left (a e^2-b d e+c d^2\right )}-\frac{\log \left (a+b x+c x^2\right ) (-a e h+b d h-c d g+c e f)}{2 c \left (a e^2-b d e+c d^2\right )}+\frac{\log (d+e x) \left (d^2 h-d e g+e^2 f\right )}{e \left (a e^2-b d e+c d^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.348852, antiderivative size = 196, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {1628, 634, 618, 206, 628} \[ -\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-c (2 a d h-2 a e g+b d g+b e f)+b h (b d-a e)+2 c^2 d f\right )}{c \sqrt{b^2-4 a c} \left (a e^2-b d e+c d^2\right )}-\frac{\log \left (a+b x+c x^2\right ) (-a e h+b d h-c d g+c e f)}{2 c \left (a e^2-b d e+c d^2\right )}+\frac{\log (d+e x) \left (d^2 h-d e g+e^2 f\right )}{e \left (a e^2-b d e+c d^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1628
Rule 634
Rule 618
Rule 206
Rule 628
Rubi steps
\begin{align*} \int \frac{f+g x+h x^2}{(d+e x) \left (a+b x+c x^2\right )} \, dx &=\int \left (\frac{e^2 f-d e g+d^2 h}{\left (c d^2-b d e+a e^2\right ) (d+e x)}+\frac{c d f-b e f+a e g-a d h-(c e f-c d g+b d h-a e h) x}{\left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac{\left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{e \left (c d^2-b d e+a e^2\right )}+\frac{\int \frac{c d f-b e f+a e g-a d h-(c e f-c d g+b d h-a e h) x}{a+b x+c x^2} \, dx}{c d^2-b d e+a e^2}\\ &=\frac{\left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{e \left (c d^2-b d e+a e^2\right )}-\frac{(c e f-c d g+b d h-a e h) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 c \left (c d^2-b d e+a e^2\right )}+\frac{\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 c \left (c d^2-b d e+a e^2\right )}\\ &=\frac{\left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{e \left (c d^2-b d e+a e^2\right )}-\frac{(c e f-c d g+b d h-a e h) \log \left (a+b x+c x^2\right )}{2 c \left (c d^2-b d e+a e^2\right )}-\frac{\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c \left (c d^2-b d e+a e^2\right )}\\ &=-\frac{\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c \sqrt{b^2-4 a c} \left (c d^2-b d e+a e^2\right )}+\frac{\left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{e \left (c d^2-b d e+a e^2\right )}-\frac{(c e f-c d g+b d h-a e h) \log \left (a+b x+c x^2\right )}{2 c \left (c d^2-b d e+a e^2\right )}\\ \end{align*}
Mathematica [A] time = 0.24331, size = 193, normalized size = 0.98 \[ \frac{-2 e \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right ) \left (c (2 a d h-2 a e g+b d g+b e f)+b h (a e-b d)-2 c^2 d f\right )+2 c \sqrt{4 a c-b^2} \log (d+e x) \left (d^2 h-d e g+e^2 f\right )-e \sqrt{4 a c-b^2} \log (a+x (b+c x)) (-a e h+b d h-c d g+c e f)}{2 c e \sqrt{4 a c-b^2} \left (e (a e-b d)+c d^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.183, size = 622, normalized size = 3.2 \begin{align*}{\frac{\ln \left ( c{x}^{2}+bx+a \right ) aeh}{ \left ( 2\,a{e}^{2}-2\,bde+2\,c{d}^{2} \right ) c}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) bdh}{ \left ( 2\,a{e}^{2}-2\,bde+2\,c{d}^{2} \right ) c}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) dg}{2\,a{e}^{2}-2\,bde+2\,c{d}^{2}}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) ef}{2\,a{e}^{2}-2\,bde+2\,c{d}^{2}}}-2\,{\frac{adh}{ \left ( a{e}^{2}-bde+c{d}^{2} \right ) \sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+2\,{\frac{aeg}{ \left ( a{e}^{2}-bde+c{d}^{2} \right ) \sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{bef}{a{e}^{2}-bde+c{d}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+2\,{\frac{cdf}{ \left ( a{e}^{2}-bde+c{d}^{2} \right ) \sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{abeh}{ \left ( a{e}^{2}-bde+c{d}^{2} \right ) c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+{\frac{{b}^{2}dh}{ \left ( a{e}^{2}-bde+c{d}^{2} \right ) c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{bdg}{a{e}^{2}-bde+c{d}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+{\frac{\ln \left ( ex+d \right ){d}^{2}h}{ \left ( a{e}^{2}-bde+c{d}^{2} \right ) e}}-{\frac{\ln \left ( ex+d \right ) dg}{a{e}^{2}-bde+c{d}^{2}}}+{\frac{e\ln \left ( ex+d \right ) f}{a{e}^{2}-bde+c{d}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.27565, size = 275, normalized size = 1.4 \begin{align*} \frac{{\left (c d g - b d h - c f e + a h e\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (c^{2} d^{2} - b c d e + a c e^{2}\right )}} + \frac{{\left (d^{2} h - d g e + f e^{2}\right )} \log \left ({\left | x e + d \right |}\right )}{c d^{2} e - b d e^{2} + a e^{3}} + \frac{{\left (2 \, c^{2} d f - b c d g + b^{2} d h - 2 \, a c d h - b c f e + 2 \, a c g e - a b h e\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{{\left (c^{2} d^{2} - b c d e + a c e^{2}\right )} \sqrt{-b^{2} + 4 \, a c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]